package com.impress;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.util.Log;

public class SyncAlarmRecevier extends BroadcastReceiver {

	@Override
	public void onReceive(Context context, Intent intent) {
		SharedPreferences settings = context.getSharedPreferences(
				context.getPackageName()+"_preferences", context.MODE_PRIVATE);
		SharedPreferences.Editor editor = settings.edit();
		editor.putString("last_update_time", 
				Utility.convertLongToDate(System.currentTimeMillis()));
		editor.commit();
		Intent sender = new Intent(context, SyncService.class);
		sender.putExtra(SyncService.AUTO_SYNC, true);
		context.startService(sender);
	}

}
